home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PAS_0793
/
FASTMOVE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-08-01
|
1KB
|
35 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 340 of 351
From : Chris Priede 1:133/311.0 03 Jul 93 00:00
To : Justin Tawil
Subj : Help in quick moves
────────────────────────────────────────────────────────────────────────────────
JT>Does anyone have an Inline source for moving bytes a word or a double
JT>word at a time..I need to copy data in and out of buffer very
JT>quickly..Thanks..
...of course...}
procedure IMove(var Src; var Dest; Count: word);
Inline(
$59/ {pop cx}
$5F/ {pop di}
$07/ {pop es}
$5E/ {pop si}
$8C/$DA/ {mov dx, ds}
$1F/ {pop ds}
$FC/ {cld}
$D1/$E9/ {shr cx, 1}
$F3/$A5/ {rep movsw}
$11/$C9/ {adc cx, cx}
$F3/$A4/ {rep movsb}
$8E/$DA {mov ds, dx}
);
Unlike TP's Move, this inline macro doesn't check if source and
destination overlap. You will get most improvement if both source and
destination are word-aligned, but it should be faster than Move in any
case (no subroutine call).